package com.itheima.localdatetime;

import java.time.LocalDateTime;

/**
 * @Author 王加鑫
 * @Date 2021/5/12 10:16
 * @Version 1.0
 */
public class LocalDateTimeTest2 {
    public static void main(String[] args) {
        //1. 获得当前日期对象
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        //2.获取当前日期中的年
        int year = now.getYear();
        System.out.println(year);
        //3.获取当前日期中的月
        int month = now.getMonthValue();
        System.out.println(month);
    }
}
